﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XConductor.Domain.Seedwork.Media;
using XConductor.Infrastructure.CrossCutting.Shared.Validator.DataAnnotations;

namespace XConductor.Domain.Shared.Media
{
    public abstract class BaseAudioFormatDescription : IAudioFormatDescription
    {
        public AudioFormats FormatTag
        {
            get;
            internal set;
        }

        public int SampleRate
        {
            get;
            internal set;
        }

        public short ChannelsPerFrame
        {
            get;
            internal set;
        }

        public int BytesPerFrame
        {
            get;
            internal set;
        }

        public short FramesPerPacket
        {
            get;
            internal set;
        }

        public short BytesPerPacket
        {
            get;
            internal set;
        }

        public short BitsPerChannel
        {
            get;
            internal set;
        }

        public int Reserved
        {
            get;
            internal set;
        }

        public void Dispose()
        { }

        public abstract IEnumerable<ValidationResult> Validate();

        public virtual bool IsValid()
        {
            return Validate().Any();
        }
    }
}
